CC=/usr/local/bin/arm-apple-darwin-gcc
CFLAGS=-g -O2 -Wall -std=c99
LDFLAGS=-Wl,-syslibroot,/usr/local/arm-apple-darwin/heavenly -lobjc -ObjC \
	-framework CoreFoundation \
	-framework Foundation \
	-framework UIKit \
	-framework LayerKit \
	-framework CoreGraphics \
	-framework GraphicsServices \
	-framework Celestial \
	-framework MusicLibrary \
	-framework WebKit \
	-framework WebCore \
	-framework OfficeImport \
	-framework MobileMusicPlayer
	
LD=$(CC)

all:    mobileJuhu package install

mobileJuhu:  main.o \
	mobileJuhuApp.o \
	UIView+Color.o \
	smcOverview.o \
	smcMainView.o \
	smcBubbleView.o \
	smcReadView.o \
	smcSettingsView.o \
	smcDelegateView.o \
	smcTextView.o \
	smcTextField.o \
	smcIconPicker.o \
	smcTableCell.o \
	smcAudioPlayback.o \
	NSDictionary+BSJSONAdditions.o \
	NSScanner+BSJSONAdditions.o \
	smcAsyncConnection.o \
	smcJaikuAPI.o \
	smcJaikuRSSParser.o \
	smcJaikuAPI+messages.o \
	smcJaikuAPI+contacts.o \
	smcJaikuAPI+finishedDownloads.o \
	smcJaikuAPI+streamPostProcess.o \
	smcJaikuAPI+streams.o \
	XMLRPCRequest.o
	$(LD) $(LDFLAGS) -o $@ $^

%.o:    %.m
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

package: mobileJuhu
	rm -fr mobileJuhu.app
	mkdir -p mobileJuhu.app
	cp mobileJuhu mobileJuhu.app/mobileJuhu
	cp Info.plist mobileJuhu.app/Info.plist
	cp resources/*.* mobileJuhu.app/
	cp resources/icons/*.png mobileJuhu.app/

clean:
	rm -frf *.o mobileJuhu mobileJuhu.app

install:
	scp -r mobileJuhu.app root@192.168.2.101:/Applications/
